﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Windows.Controls;
using SyncList.UserInterface.ValueObject;
using System.Windows.Media;
using SyncList.Business.ValueObject;

namespace SyncList.UserInterface.ValueConverters
{


    /// <summary>
    /// Convertir un Enum en Couleur de texte
    /// </summary>
    public class ExplorerItemStateValueConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            Color color = Color.FromArgb(255,0,0,0);

            ExplorerItemState state = (ExplorerItemState)value;
            switch(state)
            {
                case ExplorerItemState.IDontHaveFile:
                    break;

                case ExplorerItemState.IDontWantFile:
                    color = Color.FromArgb(255, 150, 150, 150);
                    break;

                case ExplorerItemState.IHaveFile:
                    color = Color.FromArgb(255, 0, 150, 0);
                    break;

                case ExplorerItemState.Unknown:
                    break;

                case ExplorerItemState.ICantGiveThisFile:
                    color = Color.FromArgb(255, 255, 0, 0);
                    break;

            }            
            return(new SolidColorBrush(color));
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
